package org.arkeologgr.appening.entity;

import static javax.persistence.TemporalType.TIMESTAMP;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;

@Entity
@IdClass(ItemCommentPK.class)
public class ItemComment {

	@Id
	private String entityUri;
	
	@Id
	@Temporal(TIMESTAMP)
	private Date timestamp;
	
	@OneToOne
	private ServiceUser user;
	
	@Column(length = 512)
	private String comment;

	public ItemComment() {
	}

	public ItemComment(String entityUri, ServiceUser user) {
		this.entityUri = entityUri;
		this.user = user;
	}

	public void setUser(ServiceUser user) {
		this.user = user;
	}

	public ServiceUser getUser() {
		return user;
	}

	public void setEntityUri(String entityUri) {
		this.entityUri = entityUri;
	}

	public String getEntityUri() {
		return entityUri;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public String getComment() {
		return comment;
	}

	public void setTimestamp(Date timestamp) {
		this.timestamp = timestamp;
	}

	public Date getTimestamp() {
		return timestamp;
	}
	
}
